
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>工厂模式 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-back-to-top-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-code/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchors/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-sidebar-style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-pageview-count/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-theme-comscore/test.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="单例模式.html" />
    
    
    <link rel="prev" href="设计模式.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    前言
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">基础篇</li>
        
        
    
        <li class="chapter " data-level="2.1" data-path="../java基础/IO流基础.html">
            
                <a href="../java基础/IO流基础.html">
            
                    
                    IO流基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="../java基础/集合.html">
            
                <a href="../java基础/集合.html">
            
                    
                    集合
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="../java基础/异常处理.html">
            
                <a href="../java基础/异常处理.html">
            
                    
                    异常处理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="../java基础/线程.html">
            
                <a href="../java基础/线程.html">
            
                    
                    线程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="../java基础/网络编程.html">
            
                <a href="../java基础/网络编程.html">
            
                    
                    网络编程
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">进阶篇</li>
        
        
    
        <li class="chapter " data-level="3.1" data-path="MySQL.html">
            
                <a href="MySQL.html">
            
                    
                    MySQL
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="Oracle.html">
            
                <a href="Oracle.html">
            
                    
                    Oracle
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="Redis.html">
            
                <a href="Redis.html">
            
                    
                    Redis
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.4" data-path="Netty.html">
            
                <a href="Netty.html">
            
                    
                    Netty
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.5" data-path="Spring.html">
            
                <a href="Spring.html">
            
                    
                    Spring
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.6" data-path="SpringMVC.html">
            
                <a href="SpringMVC.html">
            
                    
                    SpringMVC
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.7" data-path="单元测试.html">
            
                <a href="单元测试.html">
            
                    
                    SpringBoot单元测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.8" data-path="设计模式.html">
            
                <a href="设计模式.html">
            
                    
                    二十三个设计模式
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="3.8.1" data-path="工厂模式.html">
            
                <a href="工厂模式.html">
            
                    
                    工厂模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.8.2" data-path="单例模式.html">
            
                <a href="单例模式.html">
            
                    
                    单例模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.8.3" data-path="建造者模式.html">
            
                <a href="建造者模式.html">
            
                    
                    建造者模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.8.4" data-path="原型模式.html">
            
                <a href="原型模式.html">
            
                    
                    原型模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.8.5" data-path="适配器模式.html">
            
                <a href="适配器模式.html">
            
                    
                    适配器模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.8.6" data-path="责任链模式.html">
            
                <a href="责任链模式.html">
            
                    
                    责任链模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.8.7" data-path="桥接模式.html">
            
                <a href="桥接模式.html">
            
                    
                    桥接模式
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="header">高级篇</li>
        
        
    
        <li class="chapter " data-level="4.1" data-path="../springcloud/1.cloud架构选型.html">
            
                <a href="../springcloud/1.cloud架构选型.html">
            
                    
                    Spring Cloud
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1.1" data-path="../springcloud/2.Provider-支付模块.html">
            
                <a href="../springcloud/2.Provider-支付模块.html">
            
                    
                    Provider-支付模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.2" data-path="../springcloud/3.Consumer-订单模块.html">
            
                <a href="../springcloud/3.Consumer-订单模块.html">
            
                    
                    Consumer-订单模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.3" data-path="../springcloud/4.重构-Common模块.html">
            
                <a href="../springcloud/4.重构-Common模块.html">
            
                    
                    重构-Common模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.4" data-path="../springcloud/5.注册中心-Enreka.html">
            
                <a href="../springcloud/5.注册中心-Enreka.html">
            
                    
                    注册中心-Enreka
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.5" data-path="../springcloud/6.负载均衡-@LoadBalance.html">
            
                <a href="../springcloud/6.负载均衡-@LoadBalance.html">
            
                    
                    负载均衡-@LoadBalance
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.6" data-path="../springcloud/7.更换注册中心-Zookeeper.html">
            
                <a href="../springcloud/7.更换注册中心-Zookeeper.html">
            
                    
                    更换注册中心-Zookeeper
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.7" data-path="../springcloud/8.更换注册中心-Consul.html">
            
                <a href="../springcloud/8.更换注册中心-Consul.html">
            
                    
                    更换注册中心-Consul
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.8" data-path="../springcloud/9.负载均衡-Ribbon.html">
            
                <a href="../springcloud/9.负载均衡-Ribbon.html">
            
                    
                    负载均衡-Ribbon
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.9" data-path="../springcloud/10.服务调用-OpenFeign.html">
            
                <a href="../springcloud/10.服务调用-OpenFeign.html">
            
                    
                    服务调用-OpenFeign
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.10" data-path="../springcloud/11.熔断器-Hystrix.html">
            
                <a href="../springcloud/11.熔断器-Hystrix.html">
            
                    
                    熔断器-Hystrix
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.11" data-path="../springcloud/12.网关-Gateway.html">
            
                <a href="../springcloud/12.网关-Gateway.html">
            
                    
                    网关-Gateway
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.12" data-path="../springcloud/13.配置中心-Config.html">
            
                <a href="../springcloud/13.配置中心-Config.html">
            
                    
                    配置中心-Config
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.13" data-path="../springcloud/14.消息总线-bus.html">
            
                <a href="../springcloud/14.消息总线-bus.html">
            
                    
                    消息总线-Bus
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.14" data-path="../springcloud/15.消息驱动-stream.html">
            
                <a href="../springcloud/15.消息驱动-stream.html">
            
                    
                    消息驱动-Stream
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.15" data-path="../springcloud/16.链路监控-Sleuth.html">
            
                <a href="../springcloud/16.链路监控-Sleuth.html">
            
                    
                    链路监控-Sleuth
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.16" data-path="../springcloud/17.注册中心&配置中心-nacos.html">
            
                <a href="../springcloud/17.注册中心&配置中心-nacos.html">
            
                    
                    注册中心&配置中心-nacos
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.17" data-path="../springcloud/18.限流-sentinel.html">
            
                <a href="../springcloud/18.限流-sentinel.html">
            
                    
                    限流-sentinel
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="../java高级/JUC.html">
            
                <a href="../java高级/JUC.html">
            
                    
                    神秘的JUC包
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.3" data-path="../java高级/Docker.html">
            
                <a href="../java高级/Docker.html">
            
                    
                    Docker
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.4" data-path="../java高级/布隆过滤器.html">
            
                <a href="../java高级/布隆过滤器.html">
            
                    
                    布隆过滤器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.5" data-path="../java高级/Redission.html">
            
                <a href="../java高级/Redission.html">
            
                    
                    Redission
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.6" data-path="../java高级/MQ.html">
            
                <a href="../java高级/MQ.html">
            
                    
                    消息队列
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.7" data-path="../java高级/JVM.html">
            
                <a href="../java高级/JVM.html">
            
                    
                    JVM
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.8" data-path="../java书籍/《Effective Java》读书笔记.html">
            
                <a href="../java书籍/《Effective Java》读书笔记.html">
            
                    
                    《Effective Java》读书笔记 
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.8.1" data-path="../java书籍/创建和销毁对象.html">
            
                <a href="../java书籍/创建和销毁对象.html">
            
                    
                    创建和销毁对象
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="header">番外篇</li>
        
        
    
        <li class="chapter " data-level="5.1" data-path="../java面试/面试题.html">
            
                <a href="../java面试/面试题.html">
            
                    
                    面试题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="../番外篇/小程序.html">
            
                <a href="../番外篇/小程序.html">
            
                    
                    微信小程序
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >工厂模式</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <p>&#x5728;&#x5DE5;&#x5382;&#x6A21;&#x5F0F;&#x4E2D;&#xFF0C;&#x6211;&#x4EEC;&#x5728;&#x521B;&#x5EFA;&#x5BF9;&#x8C61;&#x65F6;&#x4E0D;&#x4F1A;&#x5BF9;&#x5BA2;&#x6237;&#x7AEF;&#x66B4;&#x9732;&#x521B;&#x5EFA;&#x903B;&#x8F91;&#xFF0C;&#x5E76;&#x4E14;&#x662F;&#x901A;&#x8FC7;&#x4F7F;&#x7528;&#x4E00;&#x4E2A;&#x5171;&#x540C;&#x7684;&#x63A5;&#x53E3;&#x6765;&#x6307;&#x5411;&#x65B0;&#x521B;&#x5EFA;&#x7684;&#x5BF9;&#x8C61;&#x3002;</p>
<p><strong>&#x5DE5;&#x5382;&#x6A21;&#x5F0F;&#x53EF;&#x4EE5;&#x5206;&#x4E3A;&#x4E09;&#x7C7B;&#xFF1A;</strong></p>
<ul>
<li>&#x7B80;&#x5355;&#x5DE5;&#x5382;&#x6A21;&#x5F0F;&#xFF08;Simple Factory&#xFF09;</li>
<li>&#x5DE5;&#x5382;&#x65B9;&#x6CD5;&#x6A21;&#x5F0F;&#xFF08;Factory Method&#xFF09;</li>
<li>&#x62BD;&#x8C61;&#x5DE5;&#x5382;&#x6A21;&#x5F0F;&#xFF08;Abstract Factory&#xFF09;</li>
</ul>
<blockquote>
<p>&#x7B80;&#x5355;&#x5DE5;&#x5382;&#x5176;&#x5B9E;&#x4E0D;&#x662F;&#x4E00;&#x4E2A;&#x6807;&#x51C6;&#x7684;&#x7684;&#x8BBE;&#x8BA1;&#x6A21;&#x5F0F;&#x3002;GOF 23 &#x79CD;&#x8BBE;&#x8BA1;&#x6A21;&#x5F0F;&#x4E2D;&#x53EA;&#x6709;&#x300C;&#x5DE5;&#x5382;&#x65B9;&#x6CD5;&#x6A21;&#x5F0F;&#x300D;&#x4E0E;&#x300C;&#x62BD;&#x8C61;&#x5DE5;&#x5382;&#x6A21;&#x5F0F;&#x300D;&#x3002;&#x7B80;&#x5355;&#x5DE5;&#x5382;&#x6A21;&#x5F0F;&#x53EF;&#x4EE5;&#x770B;&#x4E3A;&#x5DE5;&#x5382;&#x65B9;&#x6CD5;&#x6A21;&#x5F0F;&#x7684;&#x4E00;&#x79CD;&#x7279;&#x4F8B;&#xFF0C;&#x4E3A;&#x4E86;&#x7EDF;&#x4E00;&#x6574;&#x7406;&#x5B66;&#x4E60;&#xFF0C;&#x5C31;&#x90FD;&#x5F52;&#x4E3A;&#x5DE5;&#x5382;&#x6A21;&#x5F0F;&#x3002;</p>
</blockquote>
<p>&#x8FD9;&#x4E09;&#x79CD;&#x5DE5;&#x5382;&#x6A21;&#x5F0F;&#x5728;&#x8BBE;&#x8BA1;&#x6A21;&#x5F0F;&#x7684;&#x5206;&#x7C7B;&#x4E2D;&#x90FD;&#x5C5E;&#x4E8E;<strong>&#x521B;&#x5EFA;&#x578B;&#x6A21;&#x5F0F;</strong>&#xFF0C;&#x4E09;&#x79CD;&#x6A21;&#x5F0F;&#x4ECE;&#x4E0A;&#x5230;&#x4E0B;&#x9010;&#x6B65;&#x62BD;&#x8C61;&#x3002;</p>
<p><strong>&#x5DE5;&#x5382;&#x6A21;&#x5F0F;&#x7684;&#x4F18;&#x70B9;&#xFF1A;</strong></p>
<ul>
<li><strong>&#x53EF;&#x4EE5;&#x4F7F;&#x4EE3;&#x7801;&#x7ED3;&#x6784;&#x6E05;&#x6670;&#xFF0C;&#x6709;&#x6548;&#x5730;&#x5C01;&#x88C5;&#x53D8;&#x5316;</strong>&#x3002;&#x5728;&#x7F16;&#x7A0B;&#x4E2D;&#xFF0C;&#x4EA7;&#x54C1;&#x7C7B;&#x7684;&#x5B9E;&#x4F8B;&#x5316;&#x6709;&#x65F6;&#x5019;&#x662F;&#x6BD4;&#x8F83;&#x590D;&#x6742;&#x548C;&#x591A;&#x53D8;&#x7684;&#xFF0C;&#x901A;&#x8FC7;&#x5DE5;&#x5382;&#x6A21;&#x5F0F;&#xFF0C;&#x5C06;&#x4EA7;&#x54C1;&#x7684;&#x5B9E;&#x4F8B;&#x5316;&#x5C01;&#x88C5;&#x8D77;&#x6765;&#xFF0C;&#x4F7F;&#x5F97;&#x8C03;&#x7528;&#x8005;&#x6839;&#x672C;&#x65E0;&#x9700;&#x5173;&#x5FC3;&#x4EA7;&#x54C1;&#x7684;&#x5B9E;&#x4F8B;&#x5316;&#x8FC7;&#x7A0B;&#xFF0C;&#x53EA;&#x9700;&#x4F9D;&#x8D56;&#x5DE5;&#x5382;&#x5373;&#x53EF;&#x5F97;&#x5230;&#x81EA;&#x5DF1;&#x60F3;&#x8981;&#x7684;&#x4EA7;&#x54C1;&#x3002;</li>
<li><strong>&#x5BF9;&#x8C03;&#x7528;&#x8005;&#x5C4F;&#x853D;&#x5177;&#x4F53;&#x7684;&#x4EA7;&#x54C1;&#x7C7B;</strong>&#x3002;&#x5982;&#x679C;&#x4F7F;&#x7528;&#x5DE5;&#x5382;&#x6A21;&#x5F0F;&#xFF0C;&#x8C03;&#x7528;&#x8005;&#x53EA;&#x5173;&#x5FC3;&#x4EA7;&#x54C1;&#x7684;&#x63A5;&#x53E3;&#x5C31;&#x53EF;&#x4EE5;&#x4E86;&#xFF0C;&#x81F3;&#x4E8E;&#x5177;&#x4F53;&#x7684;&#x5B9E;&#x73B0;&#xFF0C;&#x8C03;&#x7528;&#x8005;&#x6839;&#x672C;&#x65E0;&#x9700;&#x5173;&#x5FC3;&#x3002;&#x5373;&#x4F7F;&#x53D8;&#x66F4;&#x4E86;&#x5177;&#x4F53;&#x7684;&#x5B9E;&#x73B0;&#xFF0C;&#x5BF9;&#x8C03;&#x7528;&#x8005;&#x6765;&#x8BF4;&#x6CA1;&#x6709;&#x4EFB;&#x4F55;&#x5F71;&#x54CD;&#x3002;</li>
<li><strong>&#x964D;&#x4F4E;&#x8026;&#x5408;&#x5EA6;</strong>&#x3002;&#x4EA7;&#x54C1;&#x7C7B;&#x7684;&#x5B9E;&#x4F8B;&#x5316;&#x901A;&#x5E38;&#x6765;&#x8BF4;&#x662F;&#x5F88;&#x590D;&#x6742;&#x7684;&#xFF0C;&#x5B83;&#x9700;&#x8981;&#x4F9D;&#x8D56;&#x5F88;&#x591A;&#x7684;&#x7C7B;&#xFF0C;&#x800C;&#x8FD9;&#x4E9B;&#x7C7B;&#x5BF9;&#x4E8E;&#x8C03;&#x7528;&#x8005;&#x6765;&#x8BF4;&#x6839;&#x672C;&#x65E0;&#x9700;&#x77E5;&#x9053;&#xFF0C;&#x5982;&#x679C;&#x4F7F;&#x7528;&#x4E86;&#x5DE5;&#x5382;&#x65B9;&#x6CD5;&#xFF0C;&#x6211;&#x4EEC;&#x9700;&#x8981;&#x505A;&#x7684;&#x4EC5;&#x4EC5;&#x662F;&#x5B9E;&#x4F8B;&#x5316;&#x597D;&#x4EA7;&#x54C1;&#x7C7B;&#xFF0C;&#x7136;&#x540E;&#x4EA4;&#x7ED9;&#x8C03;&#x7528;&#x8005;&#x4F7F;&#x7528;&#x3002;&#x5BF9;&#x8C03;&#x7528;&#x8005;&#x6765;&#x8BF4;&#xFF0C;&#x4EA7;&#x54C1;&#x6240;&#x4F9D;&#x8D56;&#x7684;&#x7C7B;&#x90FD;&#x662F;&#x900F;&#x660E;&#x7684;&#x3002;</li>
</ul>
<p><br></p>
<p><strong>&#x7B80;&#x5355;&#x5DE5;&#x5382;&#x6A21;&#x5F0F;</strong></p>
<hr>
<p>&#x4E3E;&#x4F8B;&#x6784;&#x5EFA;&#x4E00;&#x4E2A;&#x8BA1;&#x7B97;&#x5668;&#xFF1A;</p>
<pre><code class="lang-java"><span class="hljs-comment">// &#x8BA1;&#x7B97;&#x7C7B;&#x7684;&#x57FA;&#x7C7B;</span>
<span class="hljs-meta">@Setter</span>
<span class="hljs-meta">@Getter</span>
<span class="hljs-keyword">public</span> <span class="hljs-keyword">abstract</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Operation</span> </span>{
    <span class="hljs-keyword">private</span> <span class="hljs-keyword">double</span> value1 = <span class="hljs-number">0</span>;
    <span class="hljs-keyword">private</span> <span class="hljs-keyword">double</span> value2 = <span class="hljs-number">0</span>;
    <span class="hljs-function"><span class="hljs-keyword">protected</span> <span class="hljs-keyword">abstract</span> <span class="hljs-keyword">double</span> <span class="hljs-title">getResule</span><span class="hljs-params">()</span></span>;
}

<span class="hljs-comment">//&#x52A0;&#x6CD5;</span>
<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">OperationAdd</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">Operation</span> </span>{
    <span class="hljs-meta">@Override</span>
    <span class="hljs-function"><span class="hljs-keyword">protected</span> <span class="hljs-keyword">double</span> <span class="hljs-title">getResule</span><span class="hljs-params">()</span> </span>{
        <span class="hljs-keyword">return</span> getValue1() + getValue2();
    }
}
<span class="hljs-comment">//&#x51CF;&#x6CD5;</span>
<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">OperationSub</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">Operation</span> </span>{
    <span class="hljs-meta">@Override</span>
    <span class="hljs-function"><span class="hljs-keyword">protected</span> <span class="hljs-keyword">double</span> <span class="hljs-title">getResule</span><span class="hljs-params">()</span> </span>{
        <span class="hljs-keyword">return</span> getValue1() - getValue2();
    }
}
<span class="hljs-comment">//&#x4E58;&#x6CD5;</span>
<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">OperationMul</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">Operation</span> </span>{
    <span class="hljs-meta">@Override</span>
    <span class="hljs-function"><span class="hljs-keyword">protected</span> <span class="hljs-keyword">double</span> <span class="hljs-title">getResule</span><span class="hljs-params">()</span> </span>{
        <span class="hljs-keyword">return</span> getValue1() * getValue2();
    }
}
<span class="hljs-comment">//&#x9664;&#x6CD5;</span>
<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">OperationDiv</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">Operation</span> </span>{
    <span class="hljs-meta">@Override</span>
    <span class="hljs-function"><span class="hljs-keyword">protected</span> <span class="hljs-keyword">double</span> <span class="hljs-title">getResule</span><span class="hljs-params">()</span> </span>{
        <span class="hljs-keyword">if</span> (getValue2() != <span class="hljs-number">0</span>) {
            <span class="hljs-keyword">return</span> getValue1() / getValue2();
        }
        <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> IllegalArgumentException(<span class="hljs-string">&quot;&#x9664;&#x6570;&#x4E0D;&#x80FD;&#x4E3A;&#x96F6;&quot;</span>);
    }
}
</code></pre>
<p>&#x4E0B;&#x9762;&#x662F;&#x6211;&#x4EEC;&#x4F7F;&#x7528;&#x8FD9;&#x4E2A;&#x7C7B;&#x7684;&#x65F6;&#x5019;&#xFF1A;</p>
<pre><code class="lang-java"><span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">main</span><span class="hljs-params">(String[] args)</span> </span>{
  <span class="hljs-comment">//&#x8BA1;&#x7B97;&#x4E24;&#x6570;&#x4E4B;&#x548C;</span>
  OperationAdd operationAdd = <span class="hljs-keyword">new</span> OperationAdd();
  operationAdd.setValue1(<span class="hljs-number">1</span>);
  operationAdd.setValue2(<span class="hljs-number">2</span>);
  System.out.println(<span class="hljs-string">&quot;sum:&quot;</span>+operationAdd.getResule());
  <span class="hljs-comment">//&#x8BA1;&#x7B97;&#x4E24;&#x6570;&#x4E58;&#x79EF;</span>
  OperationMul operationMul = <span class="hljs-keyword">new</span> OperationMul();
  operationMul.setValue1(<span class="hljs-number">3</span>);
  operationMul.setValue2(<span class="hljs-number">5</span>);
  System.out.println(<span class="hljs-string">&quot;multiply:&quot;</span>+operationMul.getResule());
  <span class="hljs-comment">//&#x8BA1;&#x7B97;&#x4E24;&#x6570;&#x4E4B;&#x5DEE;&#x3002;&#x3002;&#x3002;</span>
}
</code></pre>
<p>&#x7B80;&#x5355;&#x5DE5;&#x5382;&#x6A21;&#x5F0F;&#x5305;&#x542B; 3 &#x4E2A;&#x89D2;&#x8272;&#xFF08;&#x8981;&#x7D20;&#xFF09;&#xFF1A;</p>
<ul>
<li>Factory&#xFF1A;&#x5373;&#x5DE5;&#x5382;&#x7C7B;&#xFF0C; &#x7B80;&#x5355;&#x5DE5;&#x5382;&#x6A21;&#x5F0F;&#x7684;&#x6838;&#x5FC3;&#x90E8;&#x5206;&#xFF0C;&#x8D1F;&#x8D23;&#x5B9E;&#x73B0;&#x521B;&#x5EFA;&#x6240;&#x6709;&#x4EA7;&#x54C1;&#x7684;&#x5185;&#x90E8;&#x903B;&#x8F91;&#xFF1B;&#x5DE5;&#x5382;&#x7C7B;&#x53EF;&#x4EE5;&#x88AB;&#x5916;&#x754C;&#x76F4;&#x63A5;&#x8C03;&#x7528;&#xFF0C;&#x521B;&#x5EFA;&#x6240;&#x9700;&#x5BF9;&#x8C61;</li>
<li>Product&#xFF1A;&#x62BD;&#x8C61;&#x7C7B;&#x4EA7;&#x54C1;&#xFF0C; &#x5B83;&#x662F;&#x5DE5;&#x5382;&#x7C7B;&#x6240;&#x521B;&#x5EFA;&#x7684;&#x6240;&#x6709;&#x5BF9;&#x8C61;&#x7684;&#x7236;&#x7C7B;&#xFF0C;&#x5C01;&#x88C5;&#x4E86;&#x5404;&#x79CD;&#x4EA7;&#x54C1;&#x5BF9;&#x8C61;&#x7684;&#x516C;&#x6709;&#x65B9;&#x6CD5;&#xFF0C;&#x5B83;&#x7684;&#x5F15;&#x5165;&#x5C06;&#x63D0;&#x9AD8;&#x7CFB;&#x7EDF;&#x7684;&#x7075;&#x6D3B;&#x6027;&#xFF0C;&#x4F7F;&#x5F97;&#x5728;&#x5DE5;&#x5382;&#x7C7B;&#x4E2D;&#x53EA;&#x9700;&#x5B9A;&#x4E49;&#x4E00;&#x4E2A;&#x901A;&#x7528;&#x7684;&#x5DE5;&#x5382;&#x65B9;&#x6CD5;&#xFF0C;&#x56E0;&#x4E3A;&#x6240;&#x6709;&#x521B;&#x5EFA;&#x7684;&#x5177;&#x4F53;&#x4EA7;&#x54C1;&#x5BF9;&#x8C61;&#x90FD;&#x662F;&#x5176;&#x5B50;&#x7C7B;&#x5BF9;&#x8C61;</li>
<li>ConcreteProduct&#xFF1A;&#x5177;&#x4F53;&#x4EA7;&#x54C1;&#xFF0C; &#x5B83;&#x662F;&#x7B80;&#x5355;&#x5DE5;&#x5382;&#x6A21;&#x5F0F;&#x7684;&#x521B;&#x5EFA;&#x76EE;&#x6807;&#xFF0C;&#x6240;&#x6709;&#x88AB;&#x521B;&#x5EFA;&#x7684;&#x5BF9;&#x8C61;&#x90FD;&#x5145;&#x5F53;&#x8FD9;&#x4E2A;&#x89D2;&#x8272;&#x7684;&#x67D0;&#x4E2A;&#x5177;&#x4F53;&#x7C7B;&#x7684;&#x5B9E;&#x4F8B;&#x3002;&#x5B83;&#x8981;&#x5B9E;&#x73B0;&#x62BD;&#x8C61;&#x4EA7;&#x54C1;&#x4E2D;&#x58F0;&#x660E;&#x7684;&#x62BD;&#x8C61;&#x65B9;&#x6CD5;</li>
</ul>
<p><img src="https://tva1.sinaimg.cn/large/e6c9d24ely1h3i1abycczj212i0pmwfx.jpg" alt="UML&#x7C7B;&#x56FE;1"></p>
<p>&#x4E0B;&#x9762;&#x7528;&#x7B80;&#x5355;&#x5DE5;&#x5382;&#xFF1A;</p>
<pre><code class="lang-java"><span class="hljs-comment">//&#x5DE5;&#x5382;&#x7C7B;</span>
<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">OperationFactory</span> </span>{

    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> Operation <span class="hljs-title">createOperation</span><span class="hljs-params">(String operation)</span> </span>{
        Operation oper = <span class="hljs-keyword">null</span>;
        <span class="hljs-keyword">switch</span> (operation) {
            <span class="hljs-keyword">case</span> <span class="hljs-string">&quot;add&quot;</span>:
                oper = <span class="hljs-keyword">new</span> OperationAdd();
                <span class="hljs-keyword">break</span>;
            <span class="hljs-keyword">case</span> <span class="hljs-string">&quot;sub&quot;</span>:
                oper = <span class="hljs-keyword">new</span> OperationSub();
                <span class="hljs-keyword">break</span>;
            <span class="hljs-keyword">case</span> <span class="hljs-string">&quot;mul&quot;</span>:
                oper = <span class="hljs-keyword">new</span> OperationMul();
                <span class="hljs-keyword">break</span>;

            <span class="hljs-keyword">case</span> <span class="hljs-string">&quot;div&quot;</span>:
                oper = <span class="hljs-keyword">new</span> OperationDiv();
                <span class="hljs-keyword">break</span>;
            <span class="hljs-keyword">default</span>:
                <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> UnsupportedOperationException(<span class="hljs-string">&quot;&#x4E0D;&#x652F;&#x6301;&#x8BE5;&#x64CD;&#x4F5C;&quot;</span>);
        }
        <span class="hljs-keyword">return</span> oper;
    }
}
</code></pre>
<p>&#x4F7F;&#x7528;&#x7B80;&#x5355;&#x5DE5;&#x5382;&#x6784;&#x5EFA;&#xFF1A;</p>
<pre><code class="lang-java"><span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">main</span><span class="hljs-params">(String[] args)</span> </span>{
  Operation operationAdd = OperationFactory.createOperation(<span class="hljs-string">&quot;add&quot;</span>);
  operationAdd.setValue1(<span class="hljs-number">1</span>);
  operationAdd.setValue2(<span class="hljs-number">2</span>)
  System.out.println(operationAdd.getResule());
}
</code></pre>
<p>&#x7B80;&#x5355;&#x5DE5;&#x5382;&#x6A21;&#x5F0F;&#x5B58;&#x5728;&#x7684;&#x95EE;&#x9898;&#xFF1A;</p>
<p>&#x5982;&#x679C;&#x6211;&#x4EEC;&#x6B64;&#x65F6;&#x518D;&#x6DFB;&#x52A0;&#x4E00;&#x4E2A;&#x5F00;&#x5E73;&#x65B9;&#x7684;&#x7C7B;&#xFF0C;&#x5C31;&#x9700;&#x8981;&#x65B0;&#x5EFA;&#x4E00;&#x4E2A;&#x5F00;&#x5E73;&#x65B9;&#x7C7B;&#x7EE7;&#x627F;Operation&#xFF0C;&#x8FD8;&#x9700;&#x8981;&#x4FEE;&#x6539;&#x5DE5;&#x5382;&#x7C7B;&#xFF0C;&#x8FD9;&#x8FDD;&#x80CC;&#x4E86;<strong>&#x5F00;&#x95ED;&#x539F;&#x5219;</strong>&#x3002;</p>
<blockquote>
<p>&#x5F00;&#x95ED;&#x539F;&#x5219;&#xFF1A;&#x5BF9;&#x62D3;&#x5C55;&#x5F00;&#x653E;&#xFF0C;&#x5BF9;&#x4FEE;&#x6539;&#x5173;&#x95ED;</p>
</blockquote>
<p><br></p>
<p><strong>&#x5DE5;&#x5382;&#x65B9;&#x6CD5;&#x6A21;&#x5F0F;</strong></p>
<hr>
<p>&#x6211;&#x4EEC;&#x5E38;&#x8BF4;&#x7684;&#x5DE5;&#x5382;&#x6A21;&#x5F0F;&#xFF0C;&#x5C31;&#x662F;&#x6307;&#x300C;&#x5DE5;&#x5382;&#x65B9;&#x6CD5;&#x6A21;&#x5F0F;&#x300D;&#xFF0C;&#x4E5F;&#x53EB;&#x300C;&#x865A;&#x62DF;&#x6784;&#x9020;&#x5668;&#x6A21;&#x5F0F;&#x300D;&#x6216;&#x300C;&#x591A;&#x6001;&#x5DE5;&#x5382;&#x6A21;&#x5F0F;&#x300D;&#x3002;&#x5DE5;&#x5382;&#x65B9;&#x6CD5;&#x8BA9;&#x7C7B;&#x7684;&#x5B9E;&#x4F8B;&#x5316;&#x63A8;&#x8FDF;&#x5230;&#x5B50;&#x7C7B;&#x6765;&#x8FDB;&#x884C;&#x3002;</p>
<p>&#x5DE5;&#x5382;&#x65B9;&#x6CD5;&#x6A21;&#x5F0F;&#x5305;&#x542B; 4 &#x4E2A;&#x89D2;&#x8272;&#xFF08;&#x8981;&#x7D20;&#xFF09;&#xFF1A;</p>
<ul>
<li>Product&#xFF1A;&#x62BD;&#x8C61;&#x4EA7;&#x54C1;&#xFF0C;&#x5B9A;&#x4E49;&#x5DE5;&#x5382;&#x65B9;&#x6CD5;&#x6240;&#x521B;&#x5EFA;&#x7684;&#x5BF9;&#x8C61;&#x7684;&#x63A5;&#x53E3;&#xFF0C;&#x4E5F;&#x5C31;&#x662F;&#x5B9E;&#x9645;&#x9700;&#x8981;&#x4F7F;&#x7528;&#x7684;&#x5BF9;&#x8C61;&#x7684;&#x63A5;&#x53E3;</li>
<li>ConcreteProduct&#xFF1A;&#x5177;&#x4F53;&#x4EA7;&#x54C1;&#xFF0C;&#x5177;&#x4F53;&#x7684; Product &#x63A5;&#x53E3;&#x7684;&#x5B9E;&#x73B0;&#x5BF9;&#x8C61;</li>
<li>Factory&#xFF1A;&#x5DE5;&#x5382;&#x63A5;&#x53E3;&#xFF0C;&#x4E5F;&#x53EF;&#x4EE5;&#x53EB; Creator(&#x521B;&#x5EFA;&#x5668;)&#xFF0C;&#x7533;&#x660E;&#x5DE5;&#x5382;&#x65B9;&#x6CD5;&#xFF0C;&#x901A;&#x5E38;&#x8FD4;&#x56DE;&#x4E00;&#x4E2A; Product &#x7C7B;&#x578B;&#x7684;&#x5B9E;&#x4F8B;&#x5BF9;&#x8C61;</li>
<li>ConcreteFactory&#xFF1A;&#x5DE5;&#x5382;&#x5B9E;&#x73B0;&#xFF0C;&#x6216;&#x8005;&#x53EB; ConcreteCreator(&#x521B;&#x5EFA;&#x5668;&#x5BF9;&#x8C61;)&#xFF0C;&#x8986;&#x76D6; Factory &#x5B9A;&#x4E49;&#x7684;&#x5DE5;&#x5382;&#x65B9;&#x6CD5;&#xFF0C;&#x8FD4;&#x56DE;&#x5177;&#x4F53;&#x7684; Product &#x5B9E;&#x4F8B;</li>
</ul>
<p><img src="https://tva1.sinaimg.cn/large/e6c9d24ely1h3i1bn8mkhj21as0mijte.jpg" alt="UML&#x7C7B;&#x56FE;2"></p>
<p>&#x5927;&#x767D;&#x8BDD;&#x5C31;&#x662F;&#xFF1A;<strong>&#x5B9A;&#x4E49;&#x4E24;&#x4E2A;&#x63A5;&#x53E3;&#xFF0C;&#x4E00;&#x4E2A;&#x662F;&#x5DE5;&#x5382;&#x63A5;&#x53E3;&#xFF0C;&#x7528;&#x4E8E;&#x521B;&#x5EFA;&#x5DE5;&#x5382;&#xFF1B;&#x4E00;&#x4E2A;&#x662F;&#x4EA7;&#x54C1;&#x63A5;&#x53E3;&#xFF0C;&#x7528;&#x4E8E;&#x521B;&#x5EFA;&#x4EA7;&#x54C1;&#x3002;&#x5DE5;&#x5382;&#x7684;&#x5177;&#x4F53;&#x7C7B;&#x751F;&#x4EA7;&#x5177;&#x4F53;&#x7684;&#x4EA7;&#x54C1;&#x3002;</strong></p>
<p>&#x4E3E;&#x4F8B;&#xFF1A;&#xFF08;&#x57FA;&#x4E8E;&#x4E0A;&#x9762;&#x7684;&#x8BA1;&#x7B97;&#x5668;&#x7684;&#x63A5;&#x53E3;&#x548C;&#x5404;&#x4E2A;&#x8BA1;&#x7B97;&#x673A;&#xFF09;</p>
<p>&#x4E0B;&#x9762;&#x662F;&#x5DE5;&#x5382;&#x63A5;&#x53E3;&#x548C;&#x5404;&#x4E2A;&#x8BA1;&#x7B97;&#x5668;&#x7684;&#x5177;&#x4F53;&#x5DE5;&#x5382;</p>
<pre><code class="lang-java"><span class="hljs-comment">//&#x5DE5;&#x5382;&#x63A5;&#x53E3;</span>
<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">interface</span> <span class="hljs-title">IFactory</span> </span>{
    <span class="hljs-function">Operation <span class="hljs-title">CreateOption</span><span class="hljs-params">()</span></span>;
}

<span class="hljs-comment">//&#x52A0;&#x6CD5;&#x7C7B;&#x5DE5;&#x5382;</span>
<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">AddFactory</span> <span class="hljs-keyword">implements</span> <span class="hljs-title">IFactory</span> </span>{
    <span class="hljs-function"><span class="hljs-keyword">public</span> Operation <span class="hljs-title">CreateOption</span><span class="hljs-params">()</span> </span>{
        <span class="hljs-keyword">return</span> <span class="hljs-keyword">new</span> OperationAdd();
    }
}

<span class="hljs-comment">//&#x51CF;&#x6CD5;&#x7C7B;&#x5DE5;&#x5382;</span>
<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">SubFactory</span> <span class="hljs-keyword">implements</span> <span class="hljs-title">IFactory</span> </span>{
    <span class="hljs-function"><span class="hljs-keyword">public</span> Operation <span class="hljs-title">CreateOption</span><span class="hljs-params">()</span> </span>{
        <span class="hljs-keyword">return</span> <span class="hljs-keyword">new</span> OperationSub();
    }
}

<span class="hljs-comment">//&#x4E58;&#x6CD5;&#x7C7B;&#x5DE5;&#x5382;</span>
<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MulFactory</span> <span class="hljs-keyword">implements</span> <span class="hljs-title">IFactory</span> </span>{
    <span class="hljs-function"><span class="hljs-keyword">public</span> Operation <span class="hljs-title">CreateOption</span><span class="hljs-params">()</span> </span>{
        <span class="hljs-keyword">return</span> <span class="hljs-keyword">new</span> OperationMul();
    }
}

<span class="hljs-comment">//&#x9664;&#x6CD5;&#x7C7B;&#x5DE5;&#x5382;</span>
<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">DivFactory</span> <span class="hljs-keyword">implements</span> <span class="hljs-title">IFactory</span> </span>{
    <span class="hljs-function"><span class="hljs-keyword">public</span> Operation <span class="hljs-title">CreateOption</span><span class="hljs-params">()</span> </span>{
        <span class="hljs-keyword">return</span> <span class="hljs-keyword">new</span> OperationDiv();
    }
}
</code></pre>
<p>&#x8FD9;&#x65F6;&#xFF0C;&#x6211;&#x4EEC;&#x4F7F;&#x7528;&#x8BA1;&#x7B97;&#x5668;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x8981;&#x4E3A;&#x6BCF;&#x79CD;&#x8FD0;&#x7B97;&#x65B9;&#x6CD5;&#x589E;&#x52A0;&#x4E00;&#x4E2A;&#x5DE5;&#x5382;&#x5BF9;&#x8C61;</p>
<pre><code class="lang-java"><span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Client</span> </span>{
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">main</span><span class="hljs-params">(String[] args)</span> </span>{
      <span class="hljs-comment">//&#x51CF;&#x6CD5;</span>
      IFactory subFactory = <span class="hljs-keyword">new</span> SubFactory();
      Operation operationSub =  subFactory.CreateOption();
      operationSub.setValue1(<span class="hljs-number">22</span>);
      operationSub.setValue2(<span class="hljs-number">20</span>);
      System.out.println(<span class="hljs-string">&quot;sub:&quot;</span>+operationSub.getResult());
      <span class="hljs-comment">//&#x9664;&#x6CD5;</span>
      IFactory Divfactory = <span class="hljs-keyword">new</span> DivFactory();
      Operation operationDiv =  Divfactory.CreateOption();
      operationDiv.setValue1(<span class="hljs-number">99</span>);
      operationDiv.setValue2(<span class="hljs-number">33</span>);
      System.out.println(<span class="hljs-string">&quot;div:&quot;</span>+operationSub.getResult());
    }
}
</code></pre>
<p>&#x5728;&#x4EE5;&#x4E0B;&#x60C5;&#x51B5;&#x4E0B;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x5DE5;&#x5382;&#x65B9;&#x6CD5;&#x6A21;&#x5F0F;&#xFF1A;</p>
<ul>
<li><strong>&#x4E00;&#x4E2A;&#x7C7B;&#x4E0D;&#x77E5;&#x9053;&#x5B83;&#x6240;&#x9700;&#x8981;&#x7684;&#x5BF9;&#x8C61;&#x7684;&#x7C7B;</strong>&#xFF1A;&#x5728;&#x5DE5;&#x5382;&#x65B9;&#x6CD5;&#x6A21;&#x5F0F;&#x4E2D;&#xFF0C;&#x5BA2;&#x6237;&#x7AEF;&#x4E0D;&#x9700;&#x8981;&#x77E5;&#x9053;&#x5177;&#x4F53;&#x4EA7;&#x54C1;&#x7C7B;&#x7684;&#x7C7B;&#x540D;&#xFF0C;&#x53EA;&#x9700;&#x8981;&#x77E5;&#x9053;&#x6240;&#x5BF9;&#x5E94;&#x7684;&#x5DE5;&#x5382;&#x5373;&#x53EF;&#xFF0C;&#x5177;&#x4F53;&#x7684;&#x4EA7;&#x54C1;&#x5BF9;&#x8C61;&#x7531;&#x5177;&#x4F53;&#x5DE5;&#x5382;&#x7C7B;&#x521B;&#x5EFA;&#xFF1B;&#x5BA2;&#x6237;&#x7AEF;&#x9700;&#x8981;&#x77E5;&#x9053;&#x521B;&#x5EFA;&#x5177;&#x4F53;&#x4EA7;&#x54C1;&#x7684;&#x5DE5;&#x5382;&#x7C7B;&#x3002;</li>
<li><strong>&#x4E00;&#x4E2A;&#x7C7B;&#x901A;&#x8FC7;&#x5176;&#x5B50;&#x7C7B;&#x6765;&#x6307;&#x5B9A;&#x521B;&#x5EFA;&#x54EA;&#x4E2A;&#x5BF9;&#x8C61;</strong>&#xFF1A;&#x5728;&#x5DE5;&#x5382;&#x65B9;&#x6CD5;&#x6A21;&#x5F0F;&#x4E2D;&#xFF0C;&#x5BF9;&#x4E8E;&#x62BD;&#x8C61;&#x5DE5;&#x5382;&#x7C7B;&#x53EA;&#x9700;&#x8981;&#x63D0;&#x4F9B;&#x4E00;&#x4E2A;&#x521B;&#x5EFA;&#x4EA7;&#x54C1;&#x7684;&#x63A5;&#x53E3;&#xFF0C;&#x800C;&#x7531;&#x5176;&#x5B50;&#x7C7B;&#x6765;&#x786E;&#x5B9A;&#x5177;&#x4F53;&#x8981;&#x521B;&#x5EFA;&#x7684;&#x5BF9;&#x8C61;&#xFF0C;&#x5229;&#x7528;&#x9762;&#x5411;&#x5BF9;&#x8C61;&#x7684;&#x591A;&#x6001;&#x6027;&#x548C;&#x91CC;&#x6C0F;&#x4EE3;&#x6362;&#x539F;&#x5219;&#xFF0C;&#x5728;&#x7A0B;&#x5E8F;&#x8FD0;&#x884C;&#x65F6;&#xFF0C;&#x5B50;&#x7C7B;&#x5BF9;&#x8C61;&#x5C06;&#x8986;&#x76D6;&#x7236;&#x7C7B;&#x5BF9;&#x8C61;&#xFF0C;&#x4ECE;&#x800C;&#x4F7F;&#x5F97;&#x7CFB;&#x7EDF;&#x66F4;&#x5BB9;&#x6613;&#x6269;&#x5C55;&#x3002;</li>
<li>&#x5C06;&#x521B;&#x5EFA;&#x5BF9;&#x8C61;&#x7684;&#x4EFB;&#x52A1;&#x59D4;&#x6258;&#x7ED9;&#x591A;&#x4E2A;&#x5DE5;&#x5382;&#x5B50;&#x7C7B;&#x4E2D;&#x7684;&#x67D0;&#x4E00;&#x4E2A;&#xFF0C;&#x5BA2;&#x6237;&#x7AEF;&#x5728;&#x4F7F;&#x7528;&#x65F6;&#x53EF;&#x4EE5;&#x65E0;&#x987B;&#x5173;&#x5FC3;&#x662F;&#x54EA;&#x4E00;&#x4E2A;&#x5DE5;&#x5382;&#x5B50;&#x7C7B;&#x521B;&#x5EFA;&#x4EA7;&#x54C1;&#x5B50;&#x7C7B;&#xFF0C;&#x9700;&#x8981;&#x65F6;&#x518D;&#x52A8;&#x6001;&#x6307;&#x5B9A;&#xFF0C;&#x53EF;&#x5C06;&#x5177;&#x4F53;&#x5DE5;&#x5382;&#x7C7B;&#x7684;&#x7C7B;&#x540D;&#x5B58;&#x50A8;&#x5728;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x6216;&#x6570;&#x636E;&#x5E93;&#x4E2D;&#x3002;</li>
<li>&#x65E5;&#x5FD7;&#x8BB0;&#x5F55;&#x5668;&#xFF1A;&#x8BB0;&#x5F55;&#x53EF;&#x80FD;&#x8BB0;&#x5F55;&#x5230;&#x672C;&#x5730;&#x786C;&#x76D8;&#x3001;&#x7CFB;&#x7EDF;&#x4E8B;&#x4EF6;&#x3001;&#x8FDC;&#x7A0B;&#x670D;&#x52A1;&#x5668;&#x7B49;&#xFF0C;&#x7528;&#x6237;&#x53EF;&#x4EE5;&#x9009;&#x62E9;&#x8BB0;&#x5F55;&#x65E5;&#x5FD7;&#x5230;&#x4EC0;&#x4E48;&#x5730;&#x65B9;&#x3002;</li>
<li>&#x6570;&#x636E;&#x5E93;&#x8BBF;&#x95EE;&#xFF0C;&#x5F53;&#x7528;&#x6237;&#x4E0D;&#x77E5;&#x9053;&#x6700;&#x540E;&#x7CFB;&#x7EDF;&#x91C7;&#x7528;&#x54EA;&#x4E00;&#x7C7B;&#x6570;&#x636E;&#x5E93;&#xFF0C;&#x4EE5;&#x53CA;&#x6570;&#x636E;&#x5E93;&#x53EF;&#x80FD;&#x6709;&#x53D8;&#x5316;&#x65F6;&#x3002;</li>
<li>&#x8BBE;&#x8BA1;&#x4E00;&#x4E2A;&#x8FDE;&#x63A5;&#x670D;&#x52A1;&#x5668;&#x7684;&#x6846;&#x67B6;&#xFF0C;&#x9700;&#x8981;&#x4E09;&#x4E2A;&#x534F;&#x8BAE;&#xFF0C;&quot;POP3&quot;&#x3001;&quot;IMAP&quot;&#x3001;&quot;HTTP&quot;&#xFF0C;&#x53EF;&#x4EE5;&#x628A;&#x8FD9;&#x4E09;&#x4E2A;&#x4F5C;&#x4E3A;&#x4EA7;&#x54C1;&#x7C7B;&#xFF0C;&#x5171;&#x540C;&#x5B9E;&#x73B0;&#x4E00;&#x4E2A;&#x63A5;&#x53E3;&#x3002;</li>
<li>&#x6BD4;&#x5982; Hibernate &#x6362;&#x6570;&#x636E;&#x5E93;&#x53EA;&#x9700;&#x6362;&#x65B9;&#x8A00;&#x548C;&#x9A71;&#x52A8;&#x5C31;&#x53EF;&#x4EE5;</li>
</ul>
<p>&#x7F3A;&#x70B9;&#xFF1A;</p>
<p>&#x6BCF;&#x6B21;&#x589E;&#x52A0;&#x4E00;&#x4E2A;&#x4EA7;&#x54C1;&#x65F6;&#xFF0C;&#x90FD;&#x9700;&#x8981;&#x589E;&#x52A0;&#x4E00;&#x4E2A;&#x5177;&#x4F53;&#x7C7B;&#x548C;&#x5BF9;&#x8C61;&#x5B9E;&#x73B0;&#x5DE5;&#x5382;&#xFF0C;&#x4F7F;&#x5F97;&#x7CFB;&#x7EDF;&#x4E2D;&#x7C7B;&#x7684;&#x4E2A;&#x6570;&#x6210;&#x500D;&#x589E;&#x52A0;&#xFF0C;&#x5728;&#x4E00;&#x5B9A;&#x7A0B;&#x5EA6;&#x4E0A;&#x589E;&#x52A0;&#x4E86;&#x7CFB;&#x7EDF;&#x7684;&#x590D;&#x6742;&#x5EA6;&#xFF0C;&#x540C;&#x65F6;&#x4E5F;&#x589E;&#x52A0;&#x4E86;&#x7CFB;&#x7EDF;&#x5177;&#x4F53;&#x7C7B;&#x7684;&#x4F9D;&#x8D56;&#x3002;&#x8FD9;&#x5E76;&#x4E0D;&#x662F;&#x4EC0;&#x4E48;&#x597D;&#x4E8B;&#x3002;</p>
<p><br></p>
<p><strong>&#x62BD;&#x8C61;&#x5DE5;&#x5382;</strong></p>
<hr>
<p>&#x62BD;&#x8C61;&#x5DE5;&#x5382;&#x6A21;&#x5F0F;&#x662F;&#x5DE5;&#x5382;&#x65B9;&#x6CD5;&#x6A21;&#x5F0F;&#x7684;&#x5347;&#x7EA7;&#x7248;&#x672C;&#xFF0C;&#x4ED6;&#x7528;&#x6765;&#x521B;&#x5EFA;&#x4E00;&#x7EC4;&#x76F8;&#x5173;&#x6216;&#x8005;&#x76F8;&#x4E92;&#x4F9D;&#x8D56;&#x7684;&#x5BF9;&#x8C61;&#x3002;&#x4ED6;&#x4E0E;&#x5DE5;&#x5382;&#x65B9;&#x6CD5;&#x6A21;&#x5F0F;&#x7684;&#x533A;&#x522B;&#x5C31;&#x5728;&#x4E8E;&#xFF0C;&#x5DE5;&#x5382;&#x65B9;&#x6CD5;&#x6A21;&#x5F0F;&#x9488;&#x5BF9;&#x7684;&#x662F;&#x4E00;&#x4E2A;&#x4EA7;&#x54C1;&#x7B49;&#x7EA7;&#x7ED3;&#x6784;&#xFF1B;&#x800C;&#x62BD;&#x8C61;&#x5DE5;&#x5382;&#x6A21;&#x5F0F;&#x5219;&#x662F;&#x9488;&#x5BF9;&#x7684;&#x591A;&#x4E2A;&#x4EA7;&#x54C1;&#x7B49;&#x7EA7;&#x7ED3;&#x6784;&#x3002;</p>
<p><strong>&#x4E3B;&#x8981;&#x89E3;&#x51B3;&#xFF1A;</strong>&#x4E3B;&#x8981;&#x89E3;&#x51B3;&#x63A5;&#x53E3;&#x9009;&#x62E9;&#x7684;&#x95EE;&#x9898;&#x3002;</p>
<p><strong>&#x4F55;&#x65F6;&#x4F7F;&#x7528;&#xFF1A;</strong>&#x7CFB;&#x7EDF;&#x7684;&#x4EA7;&#x54C1;&#x6709;&#x591A;&#x4E8E;&#x4E00;&#x4E2A;&#x7684;&#x4EA7;&#x54C1;&#x65CF;&#xFF0C;&#x800C;&#x7CFB;&#x7EDF;&#x53EA;&#x6D88;&#x8D39;&#x5176;&#x4E2D;&#x67D0;&#x4E00;&#x65CF;&#x7684;&#x4EA7;&#x54C1;&#x3002;</p>
<p><strong>&#x5982;&#x4F55;&#x89E3;&#x51B3;&#xFF1A;</strong>&#x5728;&#x4E00;&#x4E2A;&#x4EA7;&#x54C1;&#x65CF;&#x91CC;&#x9762;&#xFF0C;&#x5B9A;&#x4E49;&#x591A;&#x4E2A;&#x4EA7;&#x54C1;&#x3002;</p>
<p><strong>&#x5173;&#x952E;&#x4EE3;&#x7801;&#xFF1A;</strong>&#x5728;&#x4E00;&#x4E2A;&#x5DE5;&#x5382;&#x91CC;&#x805A;&#x5408;&#x591A;&#x4E2A;&#x540C;&#x7C7B;&#x4EA7;&#x54C1;&#x3002;</p>
<p><strong>&#x5E94;&#x7528;&#x5B9E;&#x4F8B;&#xFF1A;</strong>&#x5DE5;&#x4F5C;&#x4E86;&#xFF0C;&#x4E3A;&#x4E86;&#x53C2;&#x52A0;&#x4E00;&#x4E9B;&#x805A;&#x4F1A;&#xFF0C;&#x80AF;&#x5B9A;&#x6709;&#x4E24;&#x5957;&#x6216;&#x591A;&#x5957;&#x8863;&#x670D;&#x5427;&#xFF0C;&#x6BD4;&#x5982;&#x8BF4;&#x6709;&#x5546;&#x52A1;&#x88C5;&#xFF08;&#x6210;&#x5957;&#xFF0C;&#x4E00;&#x7CFB;&#x5217;&#x5177;&#x4F53;&#x4EA7;&#x54C1;&#xFF09;&#x3001;&#x65F6;&#x5C1A;&#x88C5;&#xFF08;&#x6210;&#x5957;&#xFF0C;&#x4E00;&#x7CFB;&#x5217;&#x5177;&#x4F53;&#x4EA7;&#x54C1;&#xFF09;&#xFF0C;&#x751A;&#x81F3;&#x5BF9;&#x4E8E;&#x4E00;&#x4E2A;&#x5BB6;&#x5EAD;&#x6765;&#x8BF4;&#xFF0C;&#x53EF;&#x80FD;&#x6709;&#x5546;&#x52A1;&#x5973;&#x88C5;&#x3001;&#x5546;&#x52A1;&#x7537;&#x88C5;&#x3001;&#x65F6;&#x5C1A;&#x5973;&#x88C5;&#x3001;&#x65F6;&#x5C1A;&#x7537;&#x88C5;&#xFF0C;&#x8FD9;&#x4E9B;&#x4E5F;&#x90FD;&#x662F;&#x6210;&#x5957;&#x7684;&#xFF0C;&#x5373;&#x4E00;&#x7CFB;&#x5217;&#x5177;&#x4F53;&#x4EA7;&#x54C1;&#x3002;&#x5047;&#x8BBE;&#x4E00;&#x79CD;&#x60C5;&#x51B5;&#xFF08;&#x73B0;&#x5B9E;&#x4E2D;&#x662F;&#x4E0D;&#x5B58;&#x5728;&#x7684;&#xFF0C;&#x8981;&#x4E0D;&#x7136;&#xFF0C;&#x6CA1;&#x6CD5;&#x8FDB;&#x5165;&#x5171;&#x4EA7;&#x4E3B;&#x4E49;&#x4E86;&#xFF0C;&#x4F46;&#x6709;&#x5229;&#x4E8E;&#x8BF4;&#x660E;&#x62BD;&#x8C61;&#x5DE5;&#x5382;&#x6A21;&#x5F0F;&#xFF09;&#xFF0C;&#x5728;&#x60A8;&#x7684;&#x5BB6;&#x4E2D;&#xFF0C;&#x67D0;&#x4E00;&#x4E2A;&#x8863;&#x67DC;&#xFF08;&#x5177;&#x4F53;&#x5DE5;&#x5382;&#xFF09;&#x53EA;&#x80FD;&#x5B58;&#x653E;&#x67D0;&#x4E00;&#x79CD;&#x8FD9;&#x6837;&#x7684;&#x8863;&#x670D;&#xFF08;&#x6210;&#x5957;&#xFF0C;&#x4E00;&#x7CFB;&#x5217;&#x5177;&#x4F53;&#x4EA7;&#x54C1;&#xFF09;&#xFF0C;&#x6BCF;&#x6B21;&#x62FF;&#x8FD9;&#x79CD;&#x6210;&#x5957;&#x7684;&#x8863;&#x670D;&#x65F6;&#x4E5F;&#x81EA;&#x7136;&#x8981;&#x4ECE;&#x8FD9;&#x4E2A;&#x8863;&#x67DC;&#x4E2D;&#x53D6;&#x51FA;&#x4E86;&#x3002;&#x7528; OOP &#x7684;&#x601D;&#x60F3;&#x53BB;&#x7406;&#x89E3;&#xFF0C;&#x6240;&#x6709;&#x7684;&#x8863;&#x67DC;&#xFF08;&#x5177;&#x4F53;&#x5DE5;&#x5382;&#xFF09;&#x90FD;&#x662F;&#x8863;&#x67DC;&#x7C7B;&#x7684;&#xFF08;&#x62BD;&#x8C61;&#x5DE5;&#x5382;&#xFF09;&#x67D0;&#x4E00;&#x4E2A;&#xFF0C;&#x800C;&#x6BCF;&#x4E00;&#x4EF6;&#x6210;&#x5957;&#x7684;&#x8863;&#x670D;&#x53C8;&#x5305;&#x62EC;&#x5177;&#x4F53;&#x7684;&#x4E0A;&#x8863;&#xFF08;&#x67D0;&#x4E00;&#x5177;&#x4F53;&#x4EA7;&#x54C1;&#xFF09;&#xFF0C;&#x88E4;&#x5B50;&#xFF08;&#x67D0;&#x4E00;&#x5177;&#x4F53;&#x4EA7;&#x54C1;&#xFF09;&#xFF0C;&#x8FD9;&#x4E9B;&#x5177;&#x4F53;&#x7684;&#x4E0A;&#x8863;&#x5176;&#x5B9E;&#x4E5F;&#x90FD;&#x662F;&#x4E0A;&#x8863;&#xFF08;&#x62BD;&#x8C61;&#x4EA7;&#x54C1;&#xFF09;&#xFF0C;&#x5177;&#x4F53;&#x7684;&#x88E4;&#x5B50;&#x4E5F;&#x90FD;&#x662F;&#x88E4;&#x5B50;&#xFF08;&#x53E6;&#x4E00;&#x4E2A;&#x62BD;&#x8C61;&#x4EA7;&#x54C1;&#xFF09;&#x3002;</p>
<p><strong>&#x4F7F;&#x7528;&#x573A;&#x666F;&#xFF1A;</strong> 1&#x3001;QQ &#x6362;&#x76AE;&#x80A4;&#xFF0C;&#x4E00;&#x6574;&#x5957;&#x4E00;&#x8D77;&#x6362;&#x3002; 2&#x3001;&#x751F;&#x6210;&#x4E0D;&#x540C;&#x64CD;&#x4F5C;&#x7CFB;&#x7EDF;&#x7684;&#x7A0B;&#x5E8F;&#x3002;</p>
<p>&#x628A;&#x7EF4;&#x57FA;&#x767E;&#x79D1;&#x7684;&#x4F8B;&#x5B50;&#x6539;&#x4E0B;&#x7528;&#x4E8E;&#x7406;&#x89E3;&#xFF0C;&#x5047;&#x8BBE;&#x6211;&#x4EEC;&#x8981;&#x751F;&#x4EA7;&#x4E24;&#x79CD;&#x4EA7;&#x54C1;&#xFF0C;&#x952E;&#x76D8;&#xFF08;Keyboard&#xFF09;&#x548C;&#x9F20;&#x6807;&#xFF08;Mouse&#xFF09; &#xFF0C;&#x6BCF;&#x4E00;&#x79CD;&#x4EA7;&#x54C1;&#x90FD;&#x652F;&#x6301;&#x591A;&#x79CD;&#x7CFB;&#x5217;&#xFF0C;&#x6BD4;&#x5982; Mac &#x7CFB;&#x5217;&#x548C; Windows &#x7CFB;&#x5217;&#x3002;&#x8FD9;&#x6837;&#x6BCF;&#x4E2A;&#x7CFB;&#x5217;&#x7684;&#x4EA7;&#x54C1;&#x5206;&#x522B;&#x662F; MacKeyboard WinKeyboard, MacMouse, WinMouse &#x3002;</p>
<p>&#x62BD;&#x8C61;&#x5DE5;&#x5382;&#x6A21;&#x5F0F;&#x5305;&#x542B;&#x7684;&#x89D2;&#x8272;&#xFF08;&#x8981;&#x7D20;&#xFF09;&#xFF1A;</p>
<ul>
<li>AbstractFactory&#xFF1A;&#x62BD;&#x8C61;&#x5DE5;&#x5382;&#xFF0C;&#x7528;&#x4E8E;&#x58F0;&#x660E;&#x751F;&#x6210;&#x62BD;&#x8C61;&#x4EA7;&#x54C1;&#x7684;&#x65B9;&#x6CD5;</li>
<li>ConcreteFactory&#xFF1A;&#x5177;&#x4F53;&#x5DE5;&#x5382;&#xFF0C;&#x5B9E;&#x73B0;&#x62BD;&#x8C61;&#x5DE5;&#x5382;&#x5B9A;&#x4E49;&#x7684;&#x65B9;&#x6CD5;&#xFF0C;&#x5177;&#x4F53;&#x5B9E;&#x73B0;&#x4E00;&#x7CFB;&#x5217;&#x4EA7;&#x54C1;&#x5BF9;&#x8C61;&#x7684;&#x521B;&#x5EFA;</li>
<li>AbstractProduct&#xFF1A;&#x62BD;&#x8C61;&#x4EA7;&#x54C1;&#xFF0C;&#x5B9A;&#x4E49;&#x4E00;&#x7C7B;&#x4EA7;&#x54C1;&#x5BF9;&#x8C61;&#x7684;&#x63A5;&#x53E3;</li>
<li>ConcreteProduct&#xFF1A;&#x5177;&#x4F53;&#x4EA7;&#x54C1;&#xFF0C;&#x901A;&#x5E38;&#x5728;&#x5177;&#x4F53;&#x5DE5;&#x5382;&#x91CC;&#xFF0C;&#x4F1A;&#x9009;&#x62E9;&#x5177;&#x4F53;&#x7684;&#x4EA7;&#x54C1;&#x5B9E;&#x73B0;&#xFF0C;&#x6765;&#x521B;&#x5EFA;&#x7B26;&#x5408;&#x62BD;&#x8C61;&#x5DE5;&#x5382;&#x5B9A;&#x4E49;&#x7684;&#x65B9;&#x6CD5;&#x8FD4;&#x56DE;&#x7684;&#x4EA7;&#x54C1;&#x7C7B;&#x578B;&#x7684;&#x5BF9;&#x8C61;&#x3002;</li>
<li>Client&#xFF1A;&#x5BA2;&#x6237;&#x7AEF;&#xFF0C;&#x4F7F;&#x7528;&#x62BD;&#x8C61;&#x5DE5;&#x5382;&#x6765;&#x83B7;&#x53D6;&#x4E00;&#x7CFB;&#x5217;&#x6240;&#x9700;&#x8981;&#x7684;&#x4EA7;&#x54C1;&#x5BF9;&#x8C61;</li>
</ul>
<p><img src="https://tva1.sinaimg.cn/large/e6c9d24ely1h3h5zda3psj21ig0u0who.jpg" alt="UML&#x56FE;"></p>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; mine 2022-2025 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x6587;&#x4EF6;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2022-06-28 11:45:53
</span></footer>
<script>console.log("plugin-popup....");document.onclick = function(e){ e.target.tagName === "IMG" && window.open(e.target.src,e.target.src)}</script><style>img{cursor:pointer}</style>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="设计模式.html" class="navigation navigation-prev " aria-label="Previous page: 二十三个设计模式">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="单例模式.html" class="navigation navigation-next " aria-label="Next page: 单例模式">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"工厂模式","level":"3.8.1","depth":2,"next":{"title":"单例模式","level":"3.8.2","depth":2,"path":"java进阶/单例模式.md","ref":"java进阶/单例模式.md","articles":[]},"previous":{"title":"二十三个设计模式","level":"3.8","depth":1,"path":"java进阶/设计模式.md","ref":"java进阶/设计模式.md","articles":[{"title":"工厂模式","level":"3.8.1","depth":2,"path":"java进阶/工厂模式.md","ref":"java进阶/工厂模式.md","articles":[]},{"title":"单例模式","level":"3.8.2","depth":2,"path":"java进阶/单例模式.md","ref":"java进阶/单例模式.md","articles":[]},{"title":"建造者模式","level":"3.8.3","depth":2,"path":"java进阶/建造者模式.md","ref":"java进阶/建造者模式.md","articles":[]},{"title":"原型模式","level":"3.8.4","depth":2,"path":"java进阶/原型模式.md","ref":"java进阶/原型模式.md","articles":[]},{"title":"适配器模式","level":"3.8.5","depth":2,"path":"java进阶/适配器模式.md","ref":"java进阶/适配器模式.md","articles":[]},{"title":"责任链模式","level":"3.8.6","depth":2,"path":"java进阶/责任链模式.md","ref":"java进阶/责任链模式.md","articles":[]},{"title":"桥接模式","level":"3.8.7","depth":2,"path":"java进阶/桥接模式.md","ref":"java进阶/桥接模式.md","articles":[]}]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["back-to-top-button","code","splitter","expandable-chapters-small","anchors","theme-comscore","tbfed-pagefooter","sidebar-style","pageview-count","popup"],"pluginsConfig":{"sidebar-style":{"author":"梁兴龙","title":"《Java 笔记本》"},"tbfed-pagefooter":{"copyright":"Copyright &copy mine 2022-2025","modify_label":"文件修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"splitter":{},"search":{},"popup":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"code":{"copyButtons":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"theme-comscore":{},"back-to-top-button":{},"pageview-count":{},"expandable-chapters-small":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"anchors":{}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"java进阶/工厂模式.md","mtime":"2022-06-28T03:45:53.169Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2022-08-22T03:22:22.085Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-back-to-top-button/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-code/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sidebar-style/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-pageview-count/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-theme-comscore/test.js"></script>
        
    

    </body>
</html>

